package com.bingo.generate;

import com.bingo.generate.comm.dto.ExcelDto;
import com.bingo.generate.comm.service.ExcelService;
import com.bingo.generate.comm.util.PathUtils;
import org.junit.Test;

import java.nio.file.Paths;
import java.util.Arrays;

/**
 * ClassName
 * Description
 * Create by lc
 * Date 2021/11/22 10:08
 * 导出为excel
 */
public class OutExcel {

    static {
        PathUtils.cofDir= Paths.get("C:\\temp\\gererate-path");
    }

    @Test
    public void exportConst(){
        ExcelDto dto=new ExcelDto();
        dto.setExcelPath(PathUtils.getCofPath("document/交互文档.xls"));
        {
            dto.setExcelTitleList(Arrays.asList("常量名","常量值"));
            dto.setSheetTitle("常量-操作系统");
            String[][] arr={{"苹果","1"},{"安卓","2"},{"H5","3"},};
            dto.setListArr(arr);
            ExcelService.createExcel(dto);
            // 导出来源
            dto.setSheetTitle("常量-来源");
            String[][] arrSource={{"裂变","1"},{"直推","2"},};
            dto.setListArr(arrSource);
            ExcelService.createExcel(dto);
            // 导出充值方式 以及 提现方式
            dto.setSheetTitle("常量-充值 and 提现方式");
            String[][] arrMethod={{"支付宝","1"},{"定额支付宝","11"},{"微信","2"},{"定额微信","22"},{"银联","3"},{"云闪付","4"},};
            dto.setListArr(arrMethod);
            ExcelService.createExcel(dto);
            //  导出账变类型
            dto.setSheetTitle("常量-账变类型");
            String[][] arrAccountChange={
                    {"APP余额","1"},{"积分","2"},{"代理余额","3"},{"其他余额","4"},{"普通vip","5"},{"超级vip","6"},
                    {"下载数","7"},{"观影数","8"},
            };
            dto.setListArr(arrAccountChange);
            ExcelService.createExcel(dto);
            //  导出业务类型
            dto.setSheetTitle("常量-业务类型");
            String[][] arrServerType={
                    {"每日任务","1"},{"新手任务","2"},{"推广任务","3"},{"邀请注册","4"},{"充值","5"},{"打赏","6"},
                    {"管理员修改","7"},{"提现","8"},{"app余额到其他余额","9"},{"其他余额到app余额","10"},{"代理余额到app余额","11"}
                    ,{"卡密兑换","12"},{"原路退回","13"},{"购买vip","14"},{"代理返利","15"},{"游戏","16"},
                    {"app余额到游戏余额","17"},{"游戏余额到app余额","18"}
            };
            dto.setListArr(arrServerType);
            ExcelService.createExcel(dto);

        }
    }

}
